package com.live.shop.model;

import org.json.JSONObject;

import java.io.Serializable;

public class PrologueModel  implements Serializable {
    int prologueId;
    String prologueTxt;//开场白文本
    int prologueType;//合成方式 0.暂无 1.录音 2.AI合成 3.本地音频
    int prologueState;//合成状态 0.暂无 1.已录音 2.已合成 3.已选择
    String prologueAudio;//回答音频
    int prologueStatus;//启用状态 0未启用 1启用
    int useNum;//使用次数
    String createTime;

    public PrologueModel() {
    }
    public PrologueModel(String prologueTxt, int prologueType, int prologueState, String prologueAudio) {
        this.prologueTxt = prologueTxt;
        this.prologueType = prologueType;
        this.prologueState = prologueState;
        this.prologueAudio = prologueAudio;
    }

    public static JSONObject model2Json(PrologueModel model){
        JSONObject json = new JSONObject();
        try {
            json.put("prologueId",model.getPrologueId());
            json.put("prologueTxt",model.getPrologueTxt());
            json.put("prologueType",model.getPrologueType());
            json.put("prologueState",model.getPrologueState());
            json.put("prologueAudio",model.getPrologueAudio());
            json.put("prologueStatus",model.getPrologueStatus());
            json.put("useNum",model.getUseNum());
            json.put("createTime",model.getCreateTime());
        }catch (Exception e){
            e.printStackTrace();
        }
        return json;
    }
    public static PrologueModel Json2model(JSONObject json){
        PrologueModel model = new PrologueModel();
        try {
            model.setPrologueId(json.getInt("prologueId"));
            model.setPrologueTxt(json.getString("prologueTxt"));
            model.setPrologueType(json.getInt("prologueType"));
            model.setPrologueState(json.getInt("prologueState"));
            model.setPrologueAudio(json.getString("prologueAudio"));
            model.setPrologueStatus(json.getInt("prologueStatus"));
            model.setUseNum(json.getInt("useNum"));
            model.setCreateTime(json.getString("createTime"));
        }catch (Exception e){
            e.printStackTrace();
        }
        return model;
    }

    public int getPrologueId() {
        return prologueId;
    }

    public void setPrologueId(int prologueId) {
        this.prologueId = prologueId;
    }

    public String getPrologueTxt() {
        return prologueTxt;
    }

    public void setPrologueTxt(String prologueTxt) {
        this.prologueTxt = prologueTxt;
    }

    public int getPrologueType() {
        return prologueType;
    }

    public void setPrologueType(int prologueType) {
        this.prologueType = prologueType;
    }

    public int getPrologueStatus() {
        return prologueStatus;
    }

    public void setPrologueStatus(int prologueStatus) {
        this.prologueStatus = prologueStatus;
    }

    public int getPrologueState() {
        return prologueState;
    }

    public void setPrologueState(int prologueState) {
        this.prologueState = prologueState;
    }

    public String getPrologueAudio() {
        return prologueAudio;
    }

    public void setPrologueAudio(String prologueAudio) {
        this.prologueAudio = prologueAudio;
    }

    public int getUseNum() {
        return useNum;
    }

    public void setUseNum(int useNum) {
        this.useNum = useNum;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }
}
